package com.luyuan.crm.sale.model;

public enum OrderType {
    SINGLE_PRODUCT(1, "单品"), FORMULA(2, "配方");
    private int index;

    private String name;

    private OrderType(int index, String name) {
        this.index = index;
        this.name = name;
    }

    public static OrderType valueOf(int index) {
        OrderType orderType = null;
        switch (index) {
        case 1:
            orderType = OrderType.SINGLE_PRODUCT;
            break;
        case 2:
            orderType = OrderType.FORMULA;
            break;
        default:
            orderType = null;
            break;
        }
        return orderType;
    }

    public int value() {
        return this.index;
    }

    public String getName() {
        return this.name;

    }
}
